package com.linwen.javase.desgin_pattern.BigTalkDesignPattenJAVACode._03装饰模式._5商品价格策略工厂;

/**
 * @ClassName CashReturn
 * @Description TODO
 * @Author zero
 * @DATE 2023/7/10 10:51 PM
 * @Version 1.0
 */
public class CashReturn extends CashSuper {
    private double man;
    private double jian;

    public CashReturn(int i, int i1) {
        this.man =  i;
        this.jian = i1;
    }

    @Override
    public double acceptCash(double price, int num) {
        double result = price * num;
        result -= (Math.floor(result / man) * jian);
        return result;
    }
}
